home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / awksrc.zip / MISSING / MEMCMP.C next >
Text File  |  1991-06-28  |  355b  |  19 lines

  1. /*
  2.  * memcmp --- compare strings.
  3.  *
  4.  * We use our own routine since it has to act like strcmp() for return
  5.  * value, and the BSD manual says bcmp() only returns zero/non-zero.
  6.  */
  7.  
  8. int
  9. memcmp (s1, s2, l)
  10. register char *s1, *s2;
  11. register int l;
  12. {
  13.     for (; l-- > 0; s1++, s2++) {
  14.         if (*s1 != *s2)
  15.             return (*s1 - *s2);
  16.     }
  17.     return (0);
  18. }
  19.